package servicio;


import interfazdao.ISubComponenteDAO;

import java.util.List;

import modelo.Componente;
import modelo.SubComponente;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SSubComponente {
	@Autowired
	private ISubComponenteDAO interfaceSubComponente;
	
	public void guardar(SubComponente subcomponente) {
		interfaceSubComponente.save(subcomponente);
	}

	
	public SubComponente buscarSubComponente(long id) {
		return interfaceSubComponente.findOne(id);
	}
	
	public List<SubComponente> buscarActivos() {
		List<SubComponente> subcomponentes;
		subcomponentes = interfaceSubComponente.findByEstatusTrueOrderByNombreAsc();
		return subcomponentes;
	}
	

}
